//
//  ChooseItemViewController.m
//  礼物go
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ChooseItemViewController.h"

#define chooseBarHeight 40

@interface ChooseItemViewController ()

@property(nonatomic,strong)NSMutableArray *modelArray;

@end

@implementation ChooseItemViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"选礼神器";
    self.hotCollectionView.frame = CGRectMake(0, 0, SCREENWIDTH, self.view.frame.size.height - 49);
    
    [self setUptitleBar];
    
    
    
    // Do any additional setup after loading the view.
}




-(void)getSelectList:(NSUInteger)nextCursor{
    AFNetworkReachabilityManager *netManager = [AFNetworkReachabilityManager sharedManager];
    
    NSString *urlString = [NSString stringWithFormat:@"http://api.liwushuo.com/v2/search/item_by_type?limit=20&offset=%ld",20 * nextCursor];
    [LYNetworking ly_GetWithURL:urlString Parameter:nil success:^(id result) {
        [netManager stopMonitoring];
        if (self.isUpLoading == NO) {
            //说明是下拉，就要清空数组中的数据
            [self.dataArray removeAllObjects];
        }
        NSDictionary *dataDic = [result objectForKey:@"data"];
        NSArray *itemArray = [dataDic objectForKey:@"items"];
        for (NSDictionary *dic in itemArray) {
            HotColumnModel *hotModel = [[HotColumnModel alloc] init];
            [hotModel setValuesForKeysWithDictionary:dic];
            [self.dataArray addObject:hotModel];
        }
        [self.hotCollectionView.mj_header endRefreshing];
        [self.hotCollectionView.mj_footer endRefreshing];
        [self.hotCollectionView reloadData];
    } error:^(NSError *error) {
        
        
    }];

}

-(void)setUptitleBar{

    



}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
